package com.chefu.autoparts.controller;


import com.chefu.autoparts.pojo.AutoParts;
import com.chefu.autoparts.service.AutoPartsService;
import com.chefu.common.pojo.PageResult;
import com.chefu.common.pojo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author goodgoodstudy
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/autoParts/parts")
public class AutoPartsController {

    @Autowired
    private AutoPartsService autoPartsService;

    /**
     * 查询配件
     */
    @GetMapping
    public R findParts(@RequestParam("id") Long id){
        AutoParts autoParts = autoPartsService.findParts(id);
        return R.ok().data("autoParts",autoParts);
    }
}

